<?php
namespace app\erp_meixingtiyu\logic;

use app\erp_meixingtiyu\model\ArenaPartTimeFragment as ArenaPartTimeFragmentModel;

class ArenaPart
{
    public static function getFragments($arenaPartId)
    {
        $part = ArenaPartTimeFragmentModel::getListWithFragmentsByPartId(
            $arenaPartId
        );
        $partArr = $part->toArray();
        $data = $partArr['data'];
        array_multisort(array_column(array_column($data, 'fragment'), 'sort'), SORT_ASC, $data);
        $partArr['data'] = $data;
        return $partArr;
    }
}
